package p.sglmsn.top.ext.wx.service;

import cn.hutool.cache.impl.TimedCache;
import cn.hutool.core.lang.Dict;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;

@Component
@Slf4j
public class WeChatService {
    public static final String url = "http://127.0.0.1:8073/send";
    /**
     * 登录的微信帐号
     */
    public static Set<String> LOGIN_ACCOUNT = new LinkedHashSet<>();
    public static final String FILEHELPER = "filehelper";
    static final TimedCache<String, ScheduledFuture> scheduledFutures = new TimedCache<>(1001 * 60);
    static ScheduledExecutorService executor = Executors.newScheduledThreadPool(20);

    /**
     * 键是微信id,值是 pid
     */
    public static Dict DICT = new Dict();

    static {
        scheduledFutures.schedulePrune(2000 * 60);
    }


}
